<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.net.URL"%>
<%@page import="org.jdom.Document"%>
<%@page import="org.jdom.Element"%>
<%@page import="org.jdom.input.SAXBuilder"%>
<%@page import="org.xml.sax.*"%>
<%@page import="java.text.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
</head>
<meta http-equiv="content-type" content="text/html; charset= UTF-8" />
<title>nonzero1.0 by nodethirtythree</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>


	<%
		List list = null;
		try {
			SAXBuilder parser = new SAXBuilder();
			parser.setValidation(false);
			parser.setIgnoringElementContentWhitespace(true);
			URL url = new URL(
			"http://www.kma.go.kr/wid/queryDFS.jsp?gridx=60&gridy=127");
			InputSource is = new InputSource(url.openStream());
			Document doc = parser.build(is);
			Element root = doc.getRootElement();

			Element channel = root.getChild("body");
			list = channel.getChildren("data");
			Element el = (Element) list.get(0);
	%>

	<li>---------------------------------</li>
	<li>시간:<%=el.getChildText("hour")%>시
	</li>
	<li>현재온도:<%=el.getChildText("temp")%>℃
	</li>
	<li>최고온도:<%=el.getChildText("tmx")%>℃
	</li>
	<li>최저온도:<%=el.getChildText("tmn")%>℃
	</li>
	<li>날씨:<%=el.getChildText("wfEn")%></li>
	<li>강수확률:<%=el.getChildText("pop")%>%
	</li>
	<li>습도:<%=el.getChildText("reh")%>%
	</li>
	<li>---------------------------------</li>
	<%
		} catch (Exception e) {
			e.getStackTrace();
		}
	%>
	
	
	
</body>
</html>